package com.xiongtian.springframework.beans.factory.config;

import com.xiongtian.springframework.beans.BeansException;
import com.xiongtian.springframework.beans.factory.BeanFactory;

/**
 * @Author: xiongtian
 * @CreateTime: 2025-03-27  11:35
 * @Version: 1.0
 * @Description: Extension of the {@link com.xiongtian.springframework.beans.factory.BeanFactory}
 * interface to be implemented by bean factories that are capable of
 * autowiring, provided that they want to expose this functionality for
 * existing bean instances.
 */

public interface AutowireCapableBeanFactory extends BeanFactory {


    /**
     * 执行 BeanPostProcessors 接口实现类的 postProcessBeforeInitialization 方法
     *
     * @param existingBean 已存在的 Bean
     * @param beanName     Bean 名称
     * @return Bean
     * @throws BeansException 异常
     */
    Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName) throws BeansException;

    /**
     * 执行 BeanPostProcessors 接口实现类的 postProcessorsAfterInitialization 方法
     *
     * @param existingBean 已存在的 Bean
     * @param beanName     Bean 名称
     * @return Bean
     * @throws BeansException 异常
     */
    Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName) throws BeansException;
}
